package com.yanqu.road.entity.musicroom;

import com.yanqu.road.utils.property.Property;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class MusicRoomRoutingBuilding {
    private int buildId;
    private int scheduleType; //行程类型
    private Property amountReward = new Property();
//    @FieldTypeAnnotation(desc = "美女结算次数")
    private Property beautySettleTimes = new Property();
    /**
     * 当前入住的美女
     */
    private Set<Integer> nowCheckInBeautyIds = new HashSet<>();

    /**
     * 即将入住的美女
     */
    private Set<Integer> waitCheckInBeautyIds = new HashSet<>();

    private int totalFurnitureLevel; // 家具总等级
    private int comfortAdd; // 舒适度增加
    private int moodAdd; // 心情值增加
    private int satietyAdd; // 饱食度增加
    private int comfortReduce; // 舒适度减少
    private int moodReduce; // 心情值减少
    private int satietyReduce; // 饱食度减少
    private List<List<Property>> produceExpBookList = new ArrayList<>(); // 生产经验书列表
    private List<List<Property>> produceSupportItemList = new ArrayList<>(); // 生产应援物列表

    public MusicRoomRoutingBuilding(UserMusicRoomBuildingData buildingData, int scheduleType) {
        this.scheduleType = scheduleType;
        this.buildId = buildingData.getBuildId();
//        this.nowCheckInBeautyIds = new HashSet<>(buildingData.getNowCheckInBeautyIds());
//        this.waitCheckInBeautyIds = new HashSet<>(buildingData.getWaitCheckInBeautyIds());//这里不赋值,是因为行程会变
        this.totalFurnitureLevel = buildingData.getTotalFurnitureLevel();
//        this.comfortAdd = buildingData.getComfortAdd();
//        this.moodAdd = buildingData.getMoodAdd();
//        this.satietyAdd = buildingData.getSatietyAdd();
//        this.comfortReduce = buildingData.getComfortReduce();
//        this.moodReduce = buildingData.getMoodReduce();
//        this.satietyReduce = buildingData.getSatietyReduce();
        this.produceExpBookList = new ArrayList<>(buildingData.getProduceExpBookList());
        this.produceSupportItemList = new ArrayList<>(buildingData.getProduceSupportItemList());
    }

    public void addNowBeautyId(int beautyId) {
        if (nowCheckInBeautyIds.contains(beautyId)) {
            return;
        }
        nowCheckInBeautyIds.add(beautyId);
    }

    public void removeNowBeautyId(int beautyId) {
        nowCheckInBeautyIds.remove(beautyId);
    }

    /**
     * 添加即将入住的美女
     * @param beautyId
     */
    public void addWaitCheckInBeautyId(int beautyId) {
        if (waitCheckInBeautyIds.contains(beautyId)) {
            return;
        }
        waitCheckInBeautyIds.add(beautyId);
    }

    public void removeWaitBeautyId(int beautyId) {
        waitCheckInBeautyIds.remove(beautyId);
    }

    public void clearWaitBeautyIds() {
        waitCheckInBeautyIds.clear();
    }

    public int getBuildId() {
        return buildId;
    }

    public Set<Integer> getNowCheckInBeautyIds() {
        return nowCheckInBeautyIds;
    }

    public Set<Integer> getWaitCheckInBeautyIds() {
        return waitCheckInBeautyIds;
    }

    public int getTotalFurnitureLevel() {
        return totalFurnitureLevel;
    }

    public int getComfortAdd() {
        return comfortAdd;
    }

    public int getMoodAdd() {
        return moodAdd;
    }

    public int getSatietyAdd() {
        return satietyAdd;
    }

    public int getComfortReduce() {
        return comfortReduce;
    }

    public int getMoodReduce() {
        return moodReduce;
    }

    public int getSatietyReduce() {
        return satietyReduce;
    }

    public List<List<Property>> getProduceExpBookList() {
        return produceExpBookList;
    }

    public List<List<Property>> getProduceSupportItemList() {
        return produceSupportItemList;
    }

    public void addAmountReward(Property property) {
        amountReward.addProperty(property);
    }

    public Property getAmountReward() {
        return amountReward;
    }

    public int getScheduleType() {
        return scheduleType;
    }

    public Property getBeautySettleTimes() {
        return beautySettleTimes;
    }

    public void addBeautySettleTimes(int beautyId) {
        beautySettleTimes.addProperty(beautyId, BigInteger.ONE);
    }
}
